[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 FERR(IEXP) (BOOLEAN)

 Function
  Determine whether or not an error has occurred on a channel since last
  checked.

 Syntax
  FERR(chan)

   chan = An integer expression with the channel to use for the file
          (0 through 7).

 Return Type & Value
  BOOLEAN
  Returns TRUE if an error has occurred on the specified channel since
  last checked, FALSE otherwise.

 Remarks
  There are many reasons why errors can occur during file processing.  The
  drive, path or file may not exist, the end of the file may have been
  reached, the drive may be full, there could be errors with the hardware,
  and so on.  For maximum reliability, you should use the function to check
  for errors after every file channel statement.

  PCBoard will automatically handle alerting the user of the error in most
  cases.  All you need is to know that an error occurred so that you may
  continue processing else where or clean up and exit.

 Examples
  INTEGER i
  STRING  s
  FOPEN 1,"FILE.DAT",O_RD,S_DW
  IF (FERR(1)) THEN
    PRINTLN "Error, exiting..."
    END
  ENDIF
  FGET 1,s
  WHILE (!FERR(1)) DO
    INC i
    PRINTLN "Line ",RIGHT(i,3),":  ",s
    FGET 1,s
  ENDWHILE
  FCLOSE 1

See Also:
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson